//
//  GYNetWorkTools.h
//  LockManagement
//
//  Created by apple on 2018/7/25.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import <Foundation/Foundation.h>

/** 网络成功block */
typedef void(^NetWorkingSuccessBlock)(NSDictionary * obj);

/** 网络失败回调block */
typedef void(^NetWorkingErrorBlock)(NSError * error);//_Nullable

/** 网络加载进度 */
typedef void(^NetWorkingProgress)(NSProgress * progress);

@interface GYNetWorkTools : NSObject

#pragma mark -- 接口

/**
 获取公司列表

 @param url 请求地址
 @param current 页码，默认当前页，可选
 @param pageSize 查询条数，默认为10条，可选
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestGetCompanyListWithURL:(NSString *)url current:(NSString *)current pageSize:(NSString *)pageSize success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 用户登录

 @param url 请求地址
 @param companyID 公司ID
 @param userName 用户名
 @param password 密码
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestUserLoginWithURL:(NSString *)url companyID:(NSString *)companyID userName:(NSString *)userName password:(NSString *)password success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 获取用户钥匙列表

 @param url 请求地址
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestGetKeysListWithURL:(NSString *)url current:(NSString *)current pageSize:(NSString *)pageSize success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 获取锁具列表

 @param url 请求地址
 @param lockName 锁具名称
 @param current 当前的页码
 @param pageSize 查询条数
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestGetLocksListWithURL:(NSString *)url lockName:(NSString *)lockName current:(NSString *)current pageSize:(NSString *)pageSize success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 锁具编码

 @param url 请求地址
 @param lockID 锁具ID
 @param lng 经度
 @param lat 纬度
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestLockCodeWithURL:(NSString *)url lockID:(NSString *)lockID lng:(float)lng lat:(float)lat success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 获取任务列表

 @param url 请求地址
 @param lockName 锁具名称
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestGetTasksListWithURL:(NSString *)url lockName:(NSString *)lockName keyID:(NSString *)keyID taskType:(NSString *)taskType taskState:(NSString *)taskState success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 任务申请

 @param url 请求地址
 @param keyID <#keyID description#>
 @param lockID <#lockID description#>
 @param taskName <#taskName description#>
 @param taskStart <#taskStart description#>
 @param taskEnd <#taskEnd description#>
 @param taskType <#taskType description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestTaskApplyWithURL:(NSString *)url keyID:(NSString *)keyID lockID:(NSString *)lockID taskName:(NSString *)taskName taskStart:(NSString *)taskStart taskEnd:(NSString *)taskEnd taskType:(NSString *)taskType Withsuccess:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 任务授权

 @param url 请求地址
 @param taskID <#taskID description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestTaskGiveWithURL:(NSString *)url taskID:(NSString *)taskID success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 日志上传

 @param url 请求地址
 @param logTime <#logTime description#>
 @param logType <#logType description#>
 @param keyID <#keyID description#>
 @param lockID <#lockID description#>
 @param logState <#logState description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestLogWithURL:(NSString *)url logTime:(NSString *)logTime logType:(NSString *)logType keyID:(NSString *)keyID lockID:(NSString *)lockID logState:(NSString *)logState success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 任务列表下载

 @param url <#url description#>
 @param logStart <#logStart description#>
 @param logEnd <#logEnd description#>
 @param current <#current description#>
 @param pageSize <#pageSize description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestLogListsWithURL:(NSString *)url logStart:(NSString *)logStart logEnd:(NSString *)logEnd current:(NSString *)current pageSize:(NSString *)pageSize success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 修改用户密码

 @param url 请求地址
 @param newPassword <#newPassword description#>
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestModflyUserPwdWithURL:(NSString *)url newPassword:(NSString *)newPassword success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;

/**
 用户退出登录

 @param url 请求地址
 @param successCallBack <#successCallBack description#>
 @param errorCallBack <#errorCallBack description#>
 */
+ (void)requestUserLogoutWithURL:(NSString *)url success:(NetWorkingSuccessBlock)successCallBack error:(NetWorkingErrorBlock)errorCallBack;
@end
